const fetch = require('../../utils/fetch.js')
Page({
  data:{
    loading:false,
    activeIndex:0,
    toView:'a0',
    loading:false
  },
  onLoad: function (options) {
    wx.showLoading({
      title: '努力加载中',
    })
    //请求菜单列表数据
    fetch('food/list').then(res => {
      wx.hideLoading()
      this.setData({
        listData: res.data,
        loading: true
      })
    })
  },
  selectMenu:function(e){
    let index = e.currentTarget.dataset.index
    console.log(index)
    this.setData({
      activeIndex:index,
      toView:'a'+index
    })
  }
})